package org.luxor.boot.controller;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.luxor.commons.core.config.properties.InfoProperties;
import org.luxor.commons.core.web.controller.BaseRestController;
import org.luxor.commons.core.web.data.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Slf4j
@RestController
public class IndexController extends BaseRestController {

    @Resource
    private InfoProperties properties;

    @GetMapping("/")
    public R<String> index() {
        return R.ok();
    }

    @GetMapping("/version")
    @ApiOperation("版本号")
    public R<String> version() {
        return R.ok(properties.getVersion());
    }

}
